<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class HelpCates extends Model
{
    protected $table = "c_help_cates";

    /****
     * @param $data
     * 获取备忘录列表
     */
    public function getHelpCates($param)
    {
        $where = [];
        if (isset($param['start']) && !empty($param['start'])) {  //开始时间
            $where[] = ['ins_times', '>=', $param['start']];
        }
        if (isset($param['end']) && !empty($param['end'])) {  //开始时间
            $where[] = ['ins_times', '<=', $param['end']];
        }
        $list = $this->where([['state', '=', 1]])->where($where)->orderByDesc("id")->get();
        if (!empty($list)) {
            $list = $list->toArray();
            return $list;
        }
        return [];
    }
}
